/*
 * @PageName:
 * @Description: 样品销售订单相关接口
 * @FilePath: /glm-mes-pc/src/api/sampleSalesOrder.js
 */
import request from '@/utils/request'


/* ------------------------new start---------------------------- */

// 获取部门列表
export function selectDeptAPI() {
	return request({
		headers: { repeatSubmit: false },
		url: '/glm/require/selectDept',
		method: 'post'
	})
}

// 获取各节点到达时间、处理时间、开始和结束时间
export function workGetOrderTimesToAllAPI(data) {
	return request({
		headers: { repeatSubmit: false },
		url: '/glm/sample/work/getOrderTimesToAll',
		method: 'post',
		data
	})
}

/* 获取各个节点的数量统计 */
export function workGetStatusCountsAPI(data) {
	return request({
		headers: { repeatSubmit: false },
		url: '/glm/sample/work/getStatusCounts',
		method: 'post',
		data
	})
}

// 通用列表查询接口
export function sampleWorksListAPI(data) {
	return request({
		headers: { repeatSubmit: false },
		url: '/glm/sample/work/glmSampleWorksList',
		method: 'post',
		data
	})
}

/* 新建表单保存接口 */
export function workSaveRequestAPI(data) {
	return request({
		url: '/glm/sample/work/saveRequest',
		method: 'post',
		data
	})
}

/* TODO 新建表单提交、更改状态接口 */
export function workDoStatusRequestAPI(data) {
	return request({
		url: '/glm/sample/work/doStatusRequest',
		method: 'put',
		data
	})
}
/* 更改状态id传数组的情况：待拍照多选点完成 */
export function workDoStatusRequestToListAPI(data) {
	return request({
		url: '/glm/sample/work/doStatusRequestToList',
		method: 'put',
		data
	})
}

/* 驳回、暂停接口 */
export function workDoRejectAPI(data) {
	return request({
		url: '/glm/sample/work/doReject',
		method: 'post',
		data
	})
}

// 处理暂停
export function workHandlePauseAPI(data) {
	return request({
		url: '/glm/sample/work/handlePause',
		method: 'post',
		data
	})
}

// 取消驳回、调整状态
export function workUpdateRequestToAllAPI(data) {
	return request({
		url: '/glm/sample/work/updateRequestToAll',
		method: 'put',
		data
	})
}

// 办理（处理驳回）
export function workHandleRejectAPI(data) {
	return request({
		url: '/glm/sample/work/handleReject',
		method: 'post',
		data
	})
}

// 驳回记录步骤条列表接口
export function workGetOrdersRejectAPI(data) {
	return request({
		headers: { repeatSubmit: false },
		url: '/glm/sample/work/getOrdersReject',
		method: 'post',
		data
	})
}

// 已完成状态获取上一个节点的处理时间接口
export function workGetOrderTimesAPI(data) {
	return request({
		headers: { repeatSubmit: false },
		url: '/glm/sample/work/getOrderTimes',
		method: 'post',
		data
	})
}

/* 编辑表单保存接口 */
export function workUpdateRequestAPI(data) {
	return request({
		url: '/glm/sample/work/updateRequest',
		method: 'put',
		data
	})
}

/* 编辑表单查询数据接口 */
export function getWorkFormByIdAPI(id) {
	return request({
		url: `/glm/sample/work/request/${id}`,
		method: 'get',
	})
}

/* 根据款号获取款式名称列表 */
export function getStyleNameListAPI(params) {
	return request({
		headers: { repeatSubmit: false },
		url: '/glm/base/getStyleName',
		method: 'post',
		params
	})
}

// 查询版师列表
export function workSelectPatternAPI(data) {
	return request({
		headers: { repeatSubmit: false },
		url: '/glm/sample/work/selectPattern',
		method: 'post',
		data
	})
}

// 分配版师
export function workDistributePatternAPI(data) {
	return request({
		url: '/glm/sample/work/distributePattern',
		method: 'post',
		data
	})
}

// 待制版页面查询各版师未处理流程数量接口
export function workGetPatternListAPI(params) {
	return request({
		headers: { repeatSubmit: false },
		url: '/glm/sample/work/getPatternCount',
		method: 'post',
		params
	})
}


// 待采购列表
export function workPurchaseListAPI(data) {
	return request({
		headers: { repeatSubmit: false },
		url: '/glm/sample/work/purchaseList',
		method: 'post',
		data
	})
}

// 待采购数据刷新
export function workDoErpPurchaseApplyAPI() {
	return request({
		url: '/glm/sample/work/doErpPurchaseApply',
		method: 'post',
	})
}

// 物料待入库查询列表
export function workStockListAPI(data) {
	return request({
		headers: { repeatSubmit: false },
		url: '/glm/sample/work/stockList',
		method: 'post',
		data
	})
}

// 待入库数据刷新
export function workDoErpPurStockAPI() {
	return request({
		url: '/glm/sample/work/doErpPurStock',
		method: 'post',
	})
}

// 待齐套列表
export function workGetProductionItemsByStatusAPI(data) {
	return request({
		headers: { repeatSubmit: false },
		url: '/glm/sample/work/getProductionItemsByStatus',
		method: 'post',
		data
	})
}

// 待齐套数据刷新
export function workDoErpSampleScheduleAPI() {
	return request({
		url: '/glm/sample/work/doErpSampleSchedule',
		method: 'post',
	})
}

// 待领料数据刷新
export function workDoProdMaterialAPI() {
	return request({
		url: '/glm/sample/work/doProdMaterial',
		method: 'post',
	})
}

// 待配料数据刷新
export function workDoCreateMaterialBatchAPI() {
	return request({
		url: '/glm/sample/work/doCreateMaterialBatch',
		method: 'post',
	})
}

// 待入库、待IE核算、待确认、待拍照
export function workGetEntryStockListAPI(data) {
	return request({
		headers: { repeatSubmit: false },
		url: '/glm/sample/work/getEntryStockList',
		method: 'post',
		data
	})
}

// 看板接口
export function workAccomplishBoardAPI(data) {
	return request({
		url: '/glm/sample/work/accomplishBoard',
		method: 'post',
		headers: { repeatSubmit: false },
		data
	})
}

// 暂停列表
export function workGetPauseListAPI(data) {
	return request({
		headers: { repeatSubmit: false },
		url: '/glm/sample/work/getPauseList',
		method: 'post',
		data
	})
}

// 获取节点历史操作人列表(暂停操作使用)
export function workGetPauseUserListAPI(data) {
	return request({
		headers: { repeatSubmit: false },
		url: '/glm/sample/work/getPauseUserList',
		method: 'post',
		data
	})
}


/* ------------------------new end---------------------------- */


// 驳回
export function rejectAPI(data) {
	return request({
		url: '/glm/sample/reject',
		method: 'post',
		data
	})
}

// 办理
export function confirmRejectionAPI(data) {
	return request({
		url: '/glm/sample/confirmRejection',
		method: 'post',
		data
	})
}

// 新发起人新建表单保存
export function saveRequestAPI(data) {
	return request({
		url: '/glm/sample/saveRequest',
		method: 'post',
		data
	})
}
// 新发起人更改表单草稿进行保存操作
export function updateRequestAPI(data) {
	return request({
		url: '/glm/sample/updateRequest',
		method: 'put',
		data
	})
}
// 新发起人根据id查询表单内容
export function getFormByIdAPI(id) {
	return request({
		url: `/glm/sample/request/${id}`,
		method: 'get',
	})
}
// 新发起人提交表单
export function submitRequestAPI(data) {
	return request({
		url: '/glm/sample/doStatusRequest',
		method: 'post',
		data
	})
}

// 新发起人列表新接口
export function getRequestListAPI(data) {
	return request({
		headers: { repeatSubmit: false },
		url: '/glm/sample/request/list',
		method: 'post',
		data
	})
}

// 新发起人办理
export function confirmRejectAPI(data) {
	return request({
		url: '/glm/sample/request/confirmReject',
		method: 'post',
		data
	})
}



// 工艺员驳回
export function technicianRejectAPI(data) {
	return request({
		url: '/glm/sample/request/reject',
		method: 'post',
		data
	})
}

// 待分配版师查询列表
export function getDistributePatternListAPI(data) {
	return request({
		headers: { repeatSubmit: false },
		url: '/glm/sample/distributePatternList',
		method: 'post',
		data
	})
}

// 版师列表
export function getPatternListAPI(data) {
	return request({
		headers: { repeatSubmit: false },
		url: '/glm/sample/selectPattern',
		method: 'post',
		data
	})
}

// 分配版师
export function distributePatternAPI(data) {
	return request({
		url: '/glm/sample/distributePattern',
		method: 'post',
		data
	})
}

// 待分配版师表格筛选查询
export function deduplicationPatternListAPI(params, data) {
	return request({
		headers: { repeatSubmit: false },
		url: '/glm/sample/deduplicationPatternList',
		method: 'post',
		params,
		data
	})
}

// 待制版-列表
export function getPlateMakingList(data) {
	return request({
		url: '/glm/sample/stayPlateMakingList',
		method: 'post',
		data
	})
}

// 待制版-通过/驳回
export function getPlateMakeExamine(data) {
	return request({
		url: '/glm/sample/patternDispose',
		method: 'post',
		data
	})
}

// 待制版-完成
export function plateMakeComplete(data) {
	return request({
		url: '/glm/sample/complete',
		method: 'post',
		data
	})
}

// 待制版-撤回
export function returnDistribute(data) {
	return request({
		url: '/glm/sample/returnDistribute',
		method: 'post',
		data
	})
}

// 待制版-表格筛选查询
export function distinctMakingListAPI(params, data) {
	return request({
		headers: { repeatSubmit: false },
		url: '/glm/sample/distinctMakingList',
		method: 'post',
		params,
		data
	})
}

// 待采购查询列表
export function getPurchaseListAPI(data) {
	return request({
		headers: { repeatSubmit: false },
		url: '/glm/sample/purchaseList',
		method: 'post',
		data
	})
}

// 待采购筛选查询
export function distinctPurchaseListAPI(params, data) {
	return request({
		headers: { repeatSubmit: false },
		url: '/glm/sample/distinctPurchaseList',
		method: 'post',
		params,
		data
	})
}

// 物料待入库查询列表
export function getStockListAPI(data) {
	return request({
		headers: { repeatSubmit: false },
		url: '/glm/sample/stockList',
		method: 'post',
		data
	})
}

// 物料待入库筛选接口
export function distinctStockListAPI(params, data) {
	return request({
		headers: { repeatSubmit: false },
		url: '/glm/sample/distinctStockList',
		method: 'post',
		params,
		data
	})
}

// 待齐套、待领料、待配料、待裁剪、待质检包装 列表
export function getProductionItemsByStatusAPI(data) {
	return request({
		headers: { repeatSubmit: false },
		url: '/glm/sample/getProductionItemsByStatus',
		method: 'post',
		data
	})
}

// 待配料-详情
export function getPrepareDetail(data) {
	return request({
		url: '/glm/sample/materialDetail',
		method: 'post',
		headers: { repeatSubmit: false },
		data
	})
}

// 待齐套、待领料、待配料、待裁剪、待质检包装 表格筛选查询
export function productionItemsListAPI(params, data) {
	return request({
		url: '/glm/sample/distinctGetProductionItems',
		method: 'post',
		params,
		data
	})
}

// 待缝制 列表
export function getProductionSewingAPI(data) {
	return request({
		headers: { repeatSubmit: false },
		url: '/glm/sample/getProductionSewing',
		method: 'post',
		data
	})
}

// 待缝制 表格筛选查询
export function distinctProductionSewingAPI(params, data) {
	return request({
		url: '/glm/sample/distinctProductionSewing',
		method: 'post',
		params,
		data
	})
}

// 待入库、待IE核算、待发起确认、待拍照 列表
export function getMaterialItemsAPI(data) {
	return request({
		headers: { repeatSubmit: false },
		url: '/glm/sample/getEntryStockList',
		method: 'post',
		data
	})
}

// 待IE核算-完成、待发起确认-是否拍照、待拍照-完成
export function materialItemsAPI(data) {
	return request({
		url: '/glm/sample/takePicture',
		method: 'post',
		data
	})
}

// 待入库、待IE核算、待发起确认、待拍照 表格筛选查询
export function materialItemsListAPI(params, data) {
	return request({
		url: '/glm/sample/distinctGetEntryStockList',
		method: 'post',
		params,
		data
	})
}

// 已完成、看板列表
export function getAccomplishBoardList(data) {
	return request({
		url: '/glm/sample/accomplishBoard',
		method: 'post',
		headers: { repeatSubmit: false },
		data
	})
}
// 已完成、看板筛选查询接口
export function distinctAccomplishBoardAPI(params, data) {
	return request({
		url: '/glm/sample/distinctAccomplishBoard',
		method: 'post',
		headers: { repeatSubmit: false },
		params,
		data
	})
}

// 各状态 统计个数接口
export function countStatusAPI(params) {
	return request({
		url: '/glm/sample/countStatus',
		method: 'get',
		params
	})
}

// 新增三个节点：带柴暖攻坚、工艺员、业务员数量统计接口
export function countNodeAPI(params) {
	return request({
		url: '/glm/sample/request/countStatus',
		method: 'get',
		params
	})
}

// 待采购数据刷新
export function doErpPurchaseApplyAPI() {
	return request({
		url: '/glm/sample/doErpPurchaseApply',
		method: 'post',
	})
}

// 物料待入库数据刷新
export function doErpPurchaseOrderAPI() {
	return request({
		url: '/glm/sample/doErpPurchaseOrder',
		method: 'post',
	})
}

// 待齐套数据刷新
export function doErpSampleScheduleAPI() {
	return request({
		url: '/glm/sample/doErpSampleSchedule',
		method: 'post',
	})
}

// 待领料数据刷新
export function doProdMaterialAPI() {
	return request({
		url: '/glm/sample/doProdMaterial',
		method: 'post',
	})
}

// 待配料数据刷新
export function doCreateMaterialBatchAPI() {
	return request({
		url: '/glm/sample/doCreateMaterialBatch',
		method: 'post',
	})
}

// 待入库数据刷新
export function doErpPurStockAPI() {
	return request({
		url: '/glm/sample/doErpPurStock',
		method: 'post',
	})
}